﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using System.Collections.Specialized;

namespace MyAlbum.Services
{
    public interface IConfiguration
    {
        ReadOnlyCollection<Extension> Extensions { get; }
        ReadOnlyCollection<ConfigItem> Items { get; }
        /// <summary>
        /// Try and get the specified value from the config values, if
        /// its not available, the default value is returned
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="name">The name of the config</param>
        /// <param name="defaultValue">A default value to return in case of a failure</param>
        /// <returns>The requested value or the default value</returns>
        T GetValueOrDefault<T>(string name, T defaultValue) where T : IConvertible;

         /// <summary>
        /// Gets a value indicating whether to show the statistics box
        /// </summary>
        bool ShowStatisticsBox { get; }

        /// <summary>
        /// Gets a value indicating whether to send an email verification to new users in order to validate their email address
        /// </summary>
        bool ValidateNewUsersEmail { get; }

        /// <summary>
        /// Gets a value indicating whether new users registration is allowed
        /// </summary>
        bool AllowAddUsers { get; }

        /// <summary>
        /// Gets a value indicating whether to add aspx file extension to the routes. Used for IIS6.
        /// </summary>
        bool UseAspxExtensions { get; }

        /// <summary>
        /// Update config values
        /// </summary>
        /// <param name="form"></param>
        void UpdateItems(NameValueCollection form);

        /// <summary>
        /// Gets a list of the available languages
        /// </summary>
        List<string> GetAvailableLanguages();

        /// <summary>
        /// Gets the the name of the current theme to use
        /// </summary>
        string ThemePath { get; }

        /// <summary>
        /// Gets the persistence mode to use on the site
        /// </summary>
        PersistenceModes PersistenceMode { get; }        

        /// <summary>
        /// Gets the default language to use on the site
        /// </summary>
        string DefaultLanguage { get; }

        /// <summary>
        /// Gets the title of the site
        /// </summary>
        string SiteTitle { get; }

        /// <summary>
        /// Gets the email address of the sender when sending email to the administrator or 
        /// on send to friend option
        /// </summary>
        string MailFromAddress { get; }

        /// <summary>
        /// Gets a value indicating whether to enable tracing - used for debugging mode
        /// </summary>
        bool EnableTrace { get; }

        /// <summary>
        /// Gets the mail server user name
        /// </summary>
        string MailUserName { get; }

        /// <summary>
        /// Gets the mail server password
        /// </summary>
        string MailPassword { get; }

        /// <summary>
        /// Gets the mail server address used for notifiying the administrator
        /// </summary>
        string MailHost { get; }

        /// <summary>
        /// Gets a value indicating whether to use and show the mini blog entries
        /// </summary>
        bool ShowBlog { get; }

        /// <summary>
        /// Gets a value indicating whether to use captcha on "Add reply" and "Send to friend" 
        /// </summary>
        bool UseCaptcha { get; }

        /// <summary>
        /// Gets a value indicating whether to email the admin on each new reply
        /// </summary>
        bool EmailOnReply { get; }

        /// <summary>
        /// Gets a value indicating whether to email the admin for a new support request
        /// </summary>
        bool EmailOnSupport { get; }

        /// <summary>
        /// Gets a value indicating whether to show the tags box
        /// </summary>
        bool ShowTagsBox { get; }

        /// <summary>
        /// Gets a value indicating whether to show the rss link
        /// </summary>
        bool ShowRSS { get; }

        /// <summary>
        /// Gets a value indicating whether to show the tooltips when an admin logs in
        /// </summary>
        bool ShowTooltips { get; }

        /// <summary>
        /// Gets a value indicating whether to email the admin on each site error
        /// </summary>
        bool EmailOnErrors { get; }

        /// <summary>
        /// Gets a value indicating whether to use categories on the site, or just use albums- entries
        /// </summary>
        bool UseCategories { get; }

        /// <summary>
        /// Gets a value indicating whether to show the entries by months box
        /// </summary>
        bool ShowEntriesByMonthsBox { get; }

        /// <summary>
        /// Gets a value indicating whether to show the select to friend option on each entry
        /// </summary>
        bool ShowSendToFriendBox { get; }

        /// <summary>
        /// Gets a value indicating whether to show select language box
        /// </summary>
        bool ShowLanguagesBox { get; }

        /// <summary>
        /// Gets a value indicating whether to show the W3C valid html mark
        /// </summary>
        bool ShowValidHTMLMark { get; }

        /// <summary>
        /// Gets a value indicating whether to log each site entrance
        /// </summary>
        bool LogEntrances { get; }

        /// <summary>
        /// Gets a value indicating whether to show the random entry box
        /// </summary>
        bool ShowRandomImageBox { get; }

        /// <summary>
        /// Gets a value indicating whether to show the latest entry box
        /// </summary>
        bool ShowLatestEntryBox { get; }

        /// <summary>
        /// Gets a value indicating whether to show the flash tags
        /// </summary>
        bool ShowFlashTagsBox { get; }

        /// <summary>
        /// Gets a value indicating whether this is the first the site is running
        /// </summary>
        bool FirstInstall { get; }

        /// <summary>
        /// Gets a value indicating whether to auto improve and show reply for an entry
        /// </summary>
        bool AutoApproveReplies { get; }

        /// <summary>
        /// Gets a value indicating whether to show the replies for each entry
        /// </summary>
        bool ShowReplies { get; }

        /// <summary>
        /// Gets a value indicating whether to show a slide show for each album
        /// </summary>
        bool EnableSlideShow { get; }

        /// <summary>
        /// Gets a value indicating whether to show the "Add Reply" box on each entry
        /// </summary>
        bool ShowAddRepliesBox { get; }

        /// <summary>
        /// Gets the number of entries to display in one page
        /// </summary>
        int EntriesPerPage { get; }

        /// <summary>
        /// Gets the number of posts to display on the main blog page
        /// </summary>
        int PostsPerPage { get; }

        /// <summary>
        /// Gets the default width to set for a thumb image
        /// </summary>
        int ThumbDefaultWidth { get; }

        /// <summary>
        /// Gets the default height to set for a thumb image
        /// </summary>
        int ThumbDefaultHeight { get; }

        /// <summary>
        /// Gets the number of albums to display in a row
        /// </summary>
        int AlbumsPerRow { get; }

        /// <summary>
        /// Gets the number of entries to display in a row
        /// </summary>
        int EntriesPerRow { get; }

        /// <summary>
        /// Gets the number of sections to display in a row
        /// </summary>
        int SectionsPerRow { get; }

        /// <summary>
        /// Gets the connection string if a database persistence mode is used
        /// </summary>
        string ConnectionString { get; }

        /// <summary>
        /// Gets the site's admin's email address
        /// </summary>
        string AdminEmail { get; }

        /// <summary>
        /// Gets a value indicating whether to show gravator images next to users replies
        /// </summary>
        bool UseGravators { get; }
    }
}
